
window.onresize = function () {
    $('.nav').removeClass('phone fadeInRight fadeOutRight')
}
$('#phone-menu').click(function () {
    $('.header .nav').addClass('phone')
    $('.header .nav').removeClass('fadeOutRight')
    $('.nav.phone').addClass('animated fadeInRight')
})
$('.header').on('click', '.phone', function () {
    $('.nav.phone').removeClass('fadeInRight')
    $('.nav.phone').addClass('fadeOutRight')
})

 //锚点定位
 function anchor(elm,id,num){
    $(elm).click(function(){
        $('html,body').animate({scrollTop: ($(id).offset().top-num)},1000); 
        })
    }
    anchor(".section1","#section1",0);
    anchor(".section2","#section2",0);
    anchor(".section3","#section3",0);
    anchor(".section4","#section4",0);
    anchor(".section5","#section5",0);
    anchor(".section6","#section6",0);
    anchor(".section7","#section7",0);